<?php /* Smarty version 2.6.18, created on 2016-12-06 23:35:35
         compiled from disease/add.tpl.php */ ?>
  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.header.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
  <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.left.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
   <!--主要内容开始-->
  <div class="content-wrapper">
    <section class="content">
      <div class="row">
        <section class="col-lg-12 connectedSortable">
         <div class="box box-default box-solid">
             <form action="" method="post">	
                <div class="box-header with-border">
                    <span class="fa fa-pencil" style="float:left; font-size:18px; padding-top:3px; color:#3c8dbc;" ></span>
                    <p class="box-title">因病缺课登记</p>
                </div>
                <div class="box-body">
                      <div class="form-group">
                              <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
                                   班级名称：
                              </label>
                              <div class="input-group col-md-4 col-xs-12">
                                  <select class="form-control" name="class_id"  id="class_id">
								  <option value="">请选择</option>
								  <?php $_from = $this->_tpl_vars['class_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
									  <option value="<?php echo $this->_tpl_vars['value']['class_id']; ?>
"><?php echo $this->_tpl_vars['value']['class_name']; ?>
</option>
								  <?php endforeach; endif; unset($_from); ?>
							
                                </select>
                              </div> 
                       </div>
                       <div class="form-group">
                              <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
                                   学生姓名：
                              </label>
                              <div class="input-group col-md-4 col-xs-12">
                                  <select class="form-control" name="student_id" value="student_id" id="student_id">
									<?php $_from = $this->_tpl_vars['student_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
									  <option value="<?php echo $this->_tpl_vars['value']['student_id']; ?>
"><?php echo $this->_tpl_vars['value']['student_name']; ?>
</option>
									<?php endforeach; endif; unset($_from); ?>
                                </select>
                              </div> 
                       </div>
                        <div class="form-group">
                              <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
                                   日期：
                              </label>
                              <div class="input-group col-sm-2" style="float:left;">
                                     <input type="text" class="form-control" value="" id="from" name="from">
                                     <div class="input-group-addon" style="padding:6px 7px;">
                                        <i class="fa fa-calendar"></i>
                                     </div>
                                  </div>
                                  <span style="float:left;">  ~  </span >
                                  <div class="input-group col-sm-2" style="float:left;">
                                       <input type="text" class="form-control" value="" id="to" name="to">
                                        <div class="input-group-addon" style="padding:6px 7px;">
                                            <i class="fa fa-calendar"></i>
                                        </div>
                                  </div> 
                                   <div class="input-group col-sm-1">
                                       <label  style="margin-left:20px;"><input type="checkbox"  value="1" name="lack_while"> 半天</label>
                                  </div> 
                       </div>
                       <div class="form-group">
                              <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
                                   症状名称：
                              </label>
                              <div class="input-group col-md-4 col-xs-12">
                                  <select class="form-control" name="disease_id">
									<?php $_from = $this->_tpl_vars['disease_lists']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['key'] => $this->_tpl_vars['value']):
?>
									  <option value="<?php echo $this->_tpl_vars['value']['disease_id']; ?>
">
									  <?php echo $this->_tpl_vars['value']['disease_name']; ?>
 (代码：	<?php echo $this->_tpl_vars['value']['disease_code']; ?>
)</option>
									<?php endforeach; endif; unset($_from); ?>
                                </select>
                              </div> 
                       </div>
					   <div class="form-group">
                              <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
                                   其他：
                              </label>
                              <div class="input-group col-md-4 col-xs-12">
                                  <input type="text" class="form-control" name="lack_rests">
                              </div> 
                       </div>
                       <div class="form-group">
                              <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
                                   就诊：
                              </label>
                              <div class="input-group col-md-4 col-xs-12">
                                  <label class="choice"><input type="radio" name="lack_doctor"  value="1" name="lack_doctor"> 是</label>
                                  <label class="choice"><input type="radio" name="lack_doctor"  value="2" name="lack_doctor"> 否</label>
                              </div> 
                       </div>                       
                      <div class="form-group">
                              <label for="inputPassword3" class="col-sm-4 control-label text-right" style="padding-right:0; padding-left:0; font-weight:500;">
                                   登记说明：
                              </label>
                              <div class="input-group col-md-6 col-xs-12">
                                  <p style="margin:0;"><?php echo $this->_tpl_vars['explain_data']['explain_content']; ?>
</p>
                              </div> 
                       </div>
				   </div><!--box-body -->
                   <div class="box-footer text-center">
                        <button type="submit" class="btn btn-primary">保 存</button>
                   </div>
               </form>
           </div><!--box box-default box-solid-->
        </section>   
           
        </div><!--row-->
    </section>
 </div>
  <!--主要内容结束-->
    <?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "index.footer.tpl.php", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
	<script>
  $(function() {
    $( "#from" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
	  changeYear: true,
	  minDate:0,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#to" ).datepicker( "option", "minDate", selectedDate );
      }
    });
    $( "#to" ).datepicker({
      defaultDate: "+1w",
      changeMonth: true,
      changeYear: true,
      numberOfMonths:1,
      onClose: function( selectedDate ) {
        $( "#from" ).datepicker( "option", "maxDate", selectedDate );
      }
    });
  });
  </script>
  <!--二级联动-->
  <script type="text/javascript">
        $(document).ready(function () {
            $("#class_id").change(function () {		
                if ($(this).val() == "-1") {
					$("#industr").remove(); return; 
					}
                else {
			var timestamp = new Date().getTime();
			$.ajax({
			url:"index.php?a=disease.listjson",
			type:"get",
			data: "class_id=" + $("#class_id").find("option:selected").val() + "&timestamp=" + timestamp,
			dataType:"json",
			success:function(msg){
                            //实例2个字符串变量来拼接下拉列表
                            var industr = "";
                            //使用jquery解析json中的数据
                            $.each(msg, function (n, value) {
                                industr += ("<option value=\"" + value.student_id + "\">" + value.student_name);
                                industr += ("</option>");
                            });

                            $("#student_id").html(industr);			   			   
			}
			});					
                }

            });

        });
</script>